<template>
  <view class="content">
    <text style="font-size: 50rpx; font-weight: bold;">子组件A</text>
    <view class="coma_box" style="margin: 20rpx 0; padding: 10rpx; background: #f5f5f5;">
      <text>父组件传进来的值:</text>
      <text style="font-weight: bold; color: red; margin-left: 10rpx;">{{ intent || '无' }}</text>
    </view>
    <button type="primary" @click="sendData()" size="default">传值给ComB组件</button>
  </view>
</template>

<script>
export default {
  props: ['intent'],
  methods: {
    sendData() {
      console.warn("----ComA----sendData------>" + this.intent);
      uni.$emit('getIntent', this.intent);
    }
  }
}
</script>

<style scoped>
.content {
  background: #fff;
  padding: 20rpx;
  border-radius: 10rpx;
  box-shadow: 0 2rpx 10rpx rgba(0,0,0,0.1);
}
</style>